﻿@using Shp.Web.Controllers;

@{
    ViewBag.Title = "IconsOnly";
    Layout = "~/Views/Shared/_Layout.Light.cshtml";     
}

<div class="sf-menu-cntr-out">
@Html.MvcContrib().Menu().Items(menu => { 
    menu.Action<HomeController>(c => c.Index(), null, Url.Content("~/Content/ico/house.png")).DisplayText(false).Title("Home");
    menu.Content(
        @<span class="separator"></span>
    );
    menu.Link(null, null, Url.Content("~/Content/ico/document_add.png")).Title("New File");
    menu.Link(null, null, Url.Content("~/Content/ico/disk_blue.png")).Title("Save File");
    menu.Link(null, null, Url.Content("~/Content/ico/folder_open.png")).Title("Open File");
    menu.Content(
        @<span class="separator"></span>
    );
    menu.Link(null, null, Url.Content("~/Content/ico/image_insert.png")).Title("Insert Image");
    menu.Link(null, null, Url.Content("~/Content/ico/cut.png")).Disable(true).DisplayWhenDisabled(true).Title("Cut");
    menu.Link(null, null, Url.Content("~/Content/ico/copy.png")).Title("Copy");
    menu.Link(null, null, Url.Content("~/Content/ico/paste.png")).Title("Paste");
    menu.Content(
        @<span class="separator"></span>
    );
    menu.Link(null, null, Url.Content("~/Content/ico/text_bold.png")).Title("Bold");
    menu.Link(null, null, Url.Content("~/Content/ico/text_italic.png")).Title("Italic");
    menu.Link(null, null, Url.Content("~/Content/ico/text_underline.png")).Title("Underline");
    menu.Link(null, null, Url.Content("~/Content/ico/text_strikethrough.png")).Title("Strikethrough");
    menu.Content(
        @<span class="separator"></span>
    );
    menu.Link(null, null, Url.Content("~/Content/ico/application_view_tile.png")).Title("Font Color")
        .Items(sub => {            
            sub.Content(
                @:@Html.Partial("_colorpicker")
            );
        }).ListAttributes(style => "width: 170px;", @class => "sf-shadow-off");
    menu.Link(null, null, Url.Content("~/Content/ico/date.png")).Title("Insert Date");
    menu.Link(null, null, Url.Content("~/Content/ico/email.png")).Title("Email");
    menu.Link(null, null, Url.Content("~/Content/ico/layout.png")).Title("Layout");
    menu.Content(
        @<span class="separator"></span>
    );
    menu.Link(null, null, Url.Content("~/Content/ico/application_xp_terminal.png")).Title("Debugging Console");
    menu.Link(null, null, Url.Content("~/Content/ico/cog.png")).Title("Command");
    menu.Content(
        @<span class="separator"></span>
    );
    menu.Action<MenuController>(c => c.Index(), null, Url.Content("~/Content/ico/house_go.png")).DisplayText(false).Title("Menu Home");
})
</div>
<div>
    <ul>
        <li>Color-Picker Menu Item has a sub-menu</li>
        <li>Click one of the color cells in the Color-Picker sub-menu</li>
        <li>Cut Menu Item is disabled</li>
    </ul>
    <div id="echo"><ul></ul></div>
</div>

<script type="text/javascript">
    $(function () {
        // animation options are necessary to avoid IE animation opacity bleeding - caused by IE filtering
        var animationOptions = ($.support.opacity) ? { opacity: 'show', height: 'show'} : { height: 'show' };
        $('ul.sf-menu').superfish({
            hoverClass: 'sfHover',
            delay: 250,
            animation: animationOptions,
            speed: 'fast',
            autoArrows: false,
            dropShadows: false,
            disableHI: true,
            onInit: function () {
                $("table.cp a").unbind().click(function (e) {
                    echo($(this));                    
                    return false;
                });
            }
        });

        var echo = function (selector) {
            var msg = (selector.text() == "") ? "Selector Color: " + selector.css("backgroundColor") : selector.text() + " Clicked";
            var $div = $("#echo"); var $ul = $("ul", $div);
            if ($div.is(":hidden")) $div.show();
            $ul.append("<li>" + msg + "</li>");
        };
    });
</script>

@section Head{
    <link href="@Url.Content("~/Content/css/superfish.menu.test.core.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/css/iconsonly.css")" rel="stylesheet" type="text/css" />
    <style type="text/css">            
         body {background: #eee;}      
         .sf-menu-cntr-out { height: 26px; padding: 3px 0 3px 20px; border: 1px solid #aaa; border-width: 1px 0; margin-top: 50px;}        
    </style>
    <script type="text/javascript" src="@Url.Content("~/Scripts/superfish.js")"></script>
}

@{   
    ViewBag.CodeViewType = Shp.Web.Models.GridCodeViewType.IconsOnly;
}
@Html.Partial("_codeviewer")